package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysContract;
import com.bohua.intermediary.service.SysContractService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysContract")
public class SysContractController {
    @Resource
    private SysContractService sysContractService;

    @RequestMapping
    public String sysContract(){
        return "sysContract/sysContract";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysContract/addSysContract";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysContract/updateSysContract";
    }

    @RequestMapping("/getSysContracts")
    @ResponseBody
    public Lay getSysContracts(SysContract sysContract,Integer page,Integer limit){
        return sysContractService.getSysContracts(sysContract,page,limit);
    }
    @RequestMapping("/addSysContract")
    @ResponseBody
    public Msg addSysContract(SysContract sysContract){
        return sysContractService.addSysContract(sysContract);
    }

    @RequestMapping("/updateSysContract")
    @ResponseBody
    public Msg updateSysContract(SysContract sysContract){
        return sysContractService.updateSysContract(sysContract);
    }

    @RequestMapping("/delSysContract")
    @ResponseBody
    public Msg delSysContract(SysContract sysContract){
        return sysContractService.delSysContract(sysContract);
    }
}
